import knowRequest from '@/utils/knowRequest'

// 设置知识体系-获取树形列表数据
export function getAllApi(data) {
  return knowRequest({
    url: '/KnowCategory/getAll',
    method: 'get',
    params: data
  })
}

// 设置知识体系-编辑
export function getSingleByIdApi(data) {
  return knowRequest({
    url: '/KnowCategory/getSingleById',
    method: 'get',
    params: data
  })
}

// 设置知识体系-新增知识分类
export function cateInsertApi(data) {
  return knowRequest({
    url: '/KnowCategory/Insert',
    method: 'get',
    params: data
  })
}

// 编辑知识分类
export function cateUpdateApi(data) {
  return knowRequest({
    url: '/KnowCategory/Update',
    method: 'get',
    params: data
  })
}

// 删除知识分类
export function cateDeleteByIDApi(data) {
  return knowRequest({
    url: '/KnowCategory/DeleteByKnowCateId',
    method: 'get',
    params: data
  })
}

// 标签库-获得标签表
export function getAllLableApi(data) {
  return knowRequest({
    url: '/labelCategory/getAllLable',
    method: 'get',
    params: data
  })
}

// 获得知识类别
export function getKnowCategoryApi(data) {
  return knowRequest({
    url: '/RankingList/getKnowCategory',
    method: 'get',
    params: data
  })
}

// 新增标签
// http://localhost:8081/labelCategory/Insert
export function tabInsertApi(data) {
  return knowRequest({
    url: '/labelCategory/Insert',
    method: 'get',
    params: data
  })
}

// 编辑标签
export function tabUpdateApi(data) {
  return knowRequest({
    url: '/labelCategory/Update',
    method: 'get',
    params: data
  })
}

// 删除标签
export function tabDeleteByIDApi(data) {
  return knowRequest({
    url: '/labelCategory/DeleteBylabelCateId',
    method: 'get',
    params: data
  })
}

// 知识量发布-获取所有部门
export function getArchDeptApi(data) {
  return knowRequest({
    url: '/RankingList/getArchDept',
    method: 'get',
    params: data
  })
}

// 知识量发布-获得排行榜表格
// 请求参数：ArchDeptName、KnowCateName、TimeType(0123对应全部和年月日)、period
export function getTableApi(data) {
  return knowRequest({
    url: '/RankingList/getTable',
    method: 'get',
    params: data
  })
}

// 知识量发布-导出排行榜表格
export function exportApi(data) {
  return knowRequest({
    url: '/RankingList/export',
    method: 'get',
    params: data,
    responseType: 'blob'
  })
}

// 发布知识-获取发布的列表
export function getAllKnowList(data) {
  return knowRequest({
    url: '/knowMain/getAll',
    method: 'get',
    params: data
  })
}

// 发布知识-新增知识
export function addKnowAPI(data) {
  return knowRequest({
    url: '/knowMain/Insert',
    method: 'post',
    data
  })
}

// 编辑状态时新增附件
export function addFiles(data) {
  return knowRequest({
    url: '/knowArchFiles/Insert',
    method: 'post',
    data
  })
}

// 编辑知识
export function updateKnowAPI(data) {
  return knowRequest({
    url: '/knowMain/Update',
    method: 'post',
    params: data
  })
}

// 删除知识
export function deleteKnowAPI(data) {
  return knowRequest({
    url: '/knowMain/DeleteByknowId',
    method: 'get',
    params: data
  })
}

// 获取知识的打标内容
export function getKnowLabel(data) {
  return knowRequest({
    url: '/knowLabelMain/getSingle',
    method: 'get',
    params: data
  })
}
// 打标
/*
 knowLblId 打标id
 lblContent 打标内容
 notes  备注
*/
export function updateKnowLabel(data) {
  return knowRequest({
    url: '/knowLabelMain/Update',
    method: 'get',
    params: data
  })
}

// 新增打标详情
/*
 knowLblId 打标id
 lblContent 打标内容
 labelCateId 标签id
*/
export function insertKnowLabel(data) {
  return knowRequest({
    url: '/knowLabelDetail/Insert',
    method: 'get',
    params: data
  })
}

// 获得"新增打标详情"可用标签
// knowId
export function getLabelsByKnowId(data) {
  return knowRequest({
    url: '/knowLabelMain/getLabelsByKnowId',
    method: 'get',
    params: data
  })
}

// 获得右边打标详细
// knowLblId
export function getLabelsDetails(data) {
  return knowRequest({
    url: '/knowLabelDetail/getDetails',
    method: 'get',
    params: data
  })
}

// 删除右边打标详细
// labelCaknowLblDtlIdteId
export function DeleteByknowLblDtlId(data) {
  return knowRequest({
    url: '/knowLabelDetail/DeleteByknowLblDtlId',
    method: 'get',
    params: data
  })
}

// 知识的形式审核
// knowId
export function CheckKnowMain(data) {
  return knowRequest({
    url: '/knowMain/Check',
    method: 'get',
    params: data
  })
}

// 根据knowId查询知识
// knowId
export function getByKnowId(data) {
  return knowRequest({
    url: '/knowMain/getByKnowId',
    method: 'get',
    params: data
  })
}

// 查询审核者要审核的知识
// auditUser部门主管工号
export function getAuditsKM(data) {
  return knowRequest({
    url: '/knowMain/getAuditsKM',
    method: 'get',
    params: data
  })
}

// 根据knowId查询该知识下的附件
export function getFilesByKnowId(data) {
  return knowRequest({
    url: '/knowArchFiles/getByKnowId',
    method: 'get',
    params: data
  })
}

// 根据archFilesId删除附件
export function deleteByarchFilesId(data) {
  return knowRequest({
    url: '/knowArchFiles/deleteByarchFilesId',
    method: 'get',
    params: data
  })
}

// 查询所有知识类别级联
export function getCategoryAllLevels(data) {
  return knowRequest({
    url: '/KnowCategory/getAllLevels',
    method: 'get',
    params: data
  })
}

// 查询单个知识类别以及上几级
export function getCategorySingleLevels(data) {
  return knowRequest({
    url: '/KnowCategory/getSingleLevels',
    method: 'get',
    params: data
  })
}

// 查询阅读知识列表
export function getAllKnowShare(data) {
  return knowRequest({
    url: '/knowShare/getAll',
    method: 'get',
    params: data
  })
}

// 查询阅读的知识详情-主体
export function getMainDetails(data) {
  return knowRequest({
    url: '/knowDetails/MainDetails',
    method: 'get',
    params: data
  })
}

// 查询阅读的知识详情-点赞
export function getKnowPraise(data) {
  return knowRequest({
    url: '/knowDetails/getPraise',
    method: 'get',
    params: data
  })
}

// 查询阅读的知识详情-评论
export function getComments(data) {
  return knowRequest({
    url: '/knowDetails/getComments',
    method: 'get',
    params: data
  })
}

// 阅读的知识详情-进行点赞
export function praise(data) {
  return knowRequest({
    url: '/knowDetails/praise',
    method: 'get',
    params: data
  })
}

// 阅读的知识详情-进行评论
export function updateComment(data) {
  return knowRequest({
    url: '/knowDetails/updateComment',
    method: 'get',
    params: data
  })
}

// 阅读的知识详情-进行阅读
export function updateReadState(data) {
  return knowRequest({
    url: '/knowDetails/updateReadState',
    method: 'get',
    params: data
  })
}

// 档案知识化-查询所有已办结归档档案表
export function getAllArchLabelMain(data) {
  return knowRequest({
    url: '/archLabelMain/getAll',
    method: 'get',
    params: data
  })
}

// 数字知识查阅页面-新增我的知识阅读
export function insertKnowShare(data) {
  return knowRequest({
    url: '/knowShare/Insert',
    method: 'get',
    params: data
  })
}

// 打标签-选择知识类别返回可供选择的标签
export function getLabelsByKnowCateId(data) {
  return knowRequest({
    url: '/archLabelMain/getLabelsByKnowCateId',
    method: 'get',
    params: data
  })
}

// 档案知识化-查询主体内容
export function getSingleLabelMain(data) {
  return knowRequest({
    url: '/archLabelMain/getSingle',
    method: 'get',
    params: data
  })
}

// 档案知识化-返回打标的标签列表
export function getArchDetails(data) {
  return knowRequest({
    url: '/archLabelDetail/getDetails',
    method: 'get',
    params: data
  })
}

// 档案知识化-根据knowCateId返回可供选择的标签
export function getArchLabelsByKnowCateId(data) {
  return knowRequest({
    url: '/archLabelMain/getLabelsByKnowCateId',
    method: 'get',
    params: data
  })
}

// 档案知识化-根据archLblId修改archLabelMain
export function updateArchLabelMain(data) {
  return knowRequest({
    url: '/archLabelMain/Update',
    method: 'get',
    params: data
  })
}

// 档案知识化-根据archLblId返回对应的archLabelDeatil
export function getArchLabelDetails(data) {
  return knowRequest({
    url: '/archLabelDetail/getDetails',
    method: 'get',
    params: data
  })
}

// 档案知识化-新增打标详情
export function insertArchLabelDetail(data) {
  return knowRequest({
    url: '/archLabelDetail/Insert',
    method: 'get',
    params: data
  })
}

// 档案知识化-根据archLblDtlId删除对应的打标详情
export function deleteByarchLblDtlId(data) {
  return knowRequest({
    url: '/archLabelDetail/DeleteByarchLblDtlId',
    method: 'get',
    params: data
  })
}
